package com.ruoyi.room.mapper;

import com.ruoyi.room.domain.Room;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 房间信息Mapper接口
 *
 * @author ruoyi
 * @date 2025-08-14
 */
public interface RoomMapper {
    /**
     * 查询房间信息
     *
     * @param id 房间信息主键
     * @return 房间信息
     */
    public Room selectRoomById(Long id);

    /**
     * 查询房间信息列表
     *
     * @param room 房间信息
     * @return 房间信息集合
     */
    public List<Room> selectRoomList(Room room);

    /**
     * 新增房间信息
     *
     * @param room 房间信息
     * @return 结果
     */
    public int insertRoom(Room room);

    /**
     * 修改房间信息
     *
     * @param room 房间信息
     * @return 结果
     */
    public int updateRoom(Room room);

    /**
     * 删除房间信息
     *
     * @param id 房间信息主键
     * @return 结果
     */
    public int deleteRoomById(Long id);

    /**
     * 批量删除房间信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteRoomByIds(Long[] ids);

    @Delete("delete from t_room_record where room_id = #{roomId}")
    int deleteRoomRecordByRoomId(@Param("roomId") Long roomId);

    @Delete("delete from t_room_good where room_id = #{roomId}")
    int deleteRoomGoodByRoomId(@Param("roomId") Long roomId);
}
